//
//  SDHSportsMineTableCell.m
//  SDHSportsNews
//
//  Created by MichaelShan on 2021/3/6.
//

#import "SDHSportsMineTableCell.h"

@implementation SDHSportsMineTableCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
//        self.contentView.backgroundColor = [UIColor yellowColor];
        self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        
        UIView *bgView = [UIView new];
        bgView.backgroundColor = UIColorFromRGB(250, 250, 250);
        bgView.clipsToBounds = YES;
        bgView.layer.cornerRadius = 5;
        [self.contentView addSubview:bgView];
        bgView.hidden = YES;
        
        UILabel *label = [UILabel new];
        label.textColor = [UIColor blackColor];
        label.textAlignment = NSTextAlignmentLeft;
        [self.contentView addSubview:label];
        self.nameLb = label;
        
        __weak typeof(self) weakSelf = self;
        [bgView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(weakSelf.contentView).insets(UIEdgeInsetsZero);
        }];
        
        [self.nameLb mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(weakSelf.contentView).offset(10);
            make.centerY.equalTo(weakSelf.contentView);
        }];
    }
    
    return self;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
